/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package entidades;

import java.io.Serializable;
import javax.persistence.*;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author lomanda
 */
@Entity
@Table(name = "registoOperacoes")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "RegistoOperacoes.findAll", query = "SELECT r FROM RegistoOperacoes r"),
    @NamedQuery(name = "RegistoOperacoes.findByIdRegistoOperacoes", query = "SELECT r FROM RegistoOperacoes r WHERE r.idRegistoOperacoes = :idRegistoOperacoes"),
    @NamedQuery(name = "RegistoOperacoes.findByDescricao", query = "SELECT r FROM RegistoOperacoes r WHERE r.descricao = :descricao")})
public class RegistoOperacoes implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @NotNull
    @Column(name = "idRegistoOperacoes")
    private Integer idRegistoOperacoes;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 45)
    @Column(name = "descricao")
    private String descricao;

    public RegistoOperacoes() {
    }

    public RegistoOperacoes(Integer idRegistoOperacoes) {
        this.idRegistoOperacoes = idRegistoOperacoes;
    }

    public RegistoOperacoes(Integer idRegistoOperacoes, String descricao) {
        this.idRegistoOperacoes = idRegistoOperacoes;
        this.descricao = descricao;
    }

    public Integer getIdRegistoOperacoes() {
        return idRegistoOperacoes;
    }

    public void setIdRegistoOperacoes(Integer idRegistoOperacoes) {
        this.idRegistoOperacoes = idRegistoOperacoes;
    }

    public String getDescricao() {
        return descricao;
    }

    public void setDescricao(String descricao) {
        this.descricao = descricao;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idRegistoOperacoes != null ? idRegistoOperacoes.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof RegistoOperacoes)) {
            return false;
        }
        RegistoOperacoes other = (RegistoOperacoes) object;
        if ((this.idRegistoOperacoes == null && other.idRegistoOperacoes != null) || (this.idRegistoOperacoes != null && !this.idRegistoOperacoes.equals(other.idRegistoOperacoes))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entidades.RegistoOperacoes[ idRegistoOperacoes=" + idRegistoOperacoes + " ]";
    }
    
}
